const BAST_URL = import.meta.env.APP_BAST_URL;

export async function FetchPOST(url: string, params?: any, options?: any) {
  try {
    const res = await fetch(BAST_URL + url, {
      method: 'POST',
      body: JSON.stringify(params),
      ...options,
    });
    return await res.json();
  } catch (err) {
    console.log(err);
  }
}
export async function FetchGET(url: string) {
  try {
    const res = await fetch(BAST_URL + url + `?`);
    return await res.json();
  } catch (err) {
    console.log(err);
  }
}
